<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 根据字符串的返回位置
      // console.log("jay chou love".indexOf("o"));
      // console.log("jay chou love you".lastIndexOf("o"));
      // console.log("jay chou love".indexOf("z"));
      // console.log("jay chou love you".lastIndexOf("z"));

      // 根据位置返回字符串
      // console.log("jay chou love you".charAt(4));
      // console.log("jay chou love you".charCodeAt(4));
      // console.log("jay chou love you"[4]);

      // 字符串的操作方法
      // console.log("jay chou love you".concat("very","love"));

    //   console.log("jay chou love you".substr(2, 10));
    //   console.log("jay chou love you".substr(2));
    //    console.log("jay chou love you".substr());

    //   console.log("jay chou love you".substring(2,10));
    //   console.log("jay chou love you".substring(2));
    //   console.log("jay chou love you".substring());

    // console.log("jay chou love you".slice(2,10));
    // console.log("jay chou love you".slice(2));
    // console.log("jay chou love you".slice());


    

    </script>
  </body>
</html>
